package com.ruoyi.syf.common.constant;

import lombok.Getter;

/**
 * 上报数据类型
 */
@Getter
public enum EscalationDataType {
    UNIT("tb_base_risk_unit", "安全风险分析单元信息"),
    EVENTS("tb_base_risk_events", "安全风险事件信息"),
    MEASURES("tb_base_control_measures", "安全风险管控措施信息"),
    TASK("tb_base_measures_task", "隐患排查任务信息"),
    RECORD("tb_base_measures_task_record", "隐患排查记录"),
    DANGER("tb_base_danger_investigation", "隐患信息"),
    UNIT_STOP("tb_base_unit_stop", "装置停用/检维修记录"),
    REAL_TIME("real_time","实时数据"),
    ALARM("alarm","报警数据");

    private String code;
    private String name;

    public static String getNameByCode(String code) {
        for (EscalationDataType type : EscalationDataType.values()) {
            if (type.getCode().equals(code)) {
                return type.getName();
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    EscalationDataType(String code, String name) {
        this.code = code;
        this.name = name;
    }
}
